// 引入依赖项
const proxy = require('http-proxy-middleware')

module.exports = {
  devServer: {
    open: true,
    host: '0.0.0.0',
    proxy: {
      '/api': {
        target: 'http://localhost:8080', //请求数据的代理地址，这里设置的地址会代替axios中设置的baseURL
        pathRewrite: {
          '^/api': '/mock'
        }
      }
    }
  },
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/'
}
